<?php

class productsController {
	
	function __construct() {
	}
	
	public function index() {		
		$this->listprod();		
	}	

	public function listprod() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->listprod();
		echo json_encode( $data );
	}
	
	public function prodstatus() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->prodstatus();
		echo json_encode( $data );
	}
	
	public function insprod() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->insprod();
		echo json_encode( $data );
	}
	
	public function updprod() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->updprod();
		echo json_encode( $data );
	}
	
	public function delprod() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->delprod();
		echo json_encode( $data );
	}
	
	public function prodstock() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->prodstock();
		echo json_encode( $data );
	}
	
	public function listuni() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->listuni();
		echo json_encode( $data );
	}
	
	public function insuni() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->insuni();
		echo json_encode( $data );
	}
	
	public function upduni() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->upduni();
		echo json_encode( $data );
	}
	
	public function deluni() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->deluni();
		echo json_encode( $data );
	}
	
	public function selstockone() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->selstockone();
		echo json_encode( $data );
	}
	
	public function getstockone() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->getstockone();
		echo json_encode( $data );
	}
	
	public function retstocklist() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->retstocklist();
		echo json_encode( $data );
	}
	
	public function getstocklist() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->getstocklist();
		echo json_encode( $data );
	}
	
	public function specstate() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new products;
		$data = $model->specstate();
		echo json_encode( $data );
	}
	
	public function jsload() {		
		if( !Tools::isAjax() ) return;
		App::me()->js_load('products.js');
	}	
	
}
?>